<?php
$year=2014;
$month=7;
$day=17;
$sum=0;
switch($month){
	case 1: $sum=0; break;
	case 2: $sum=31; break;
	case 3: $sum=61; break;
	case 4: $sum=92; break;
	case 5: $sun=122; break;
	case 6: $sum=152; break;
	case 7: $sum=183; break;
	case 8: $sun=213; break;
	case 9: $sum=244; break;
	case 10: $sum=274; break;
	case 11: $sum=305; break;
	case 12: $sum=335; break;
	default: 
	echo "date error";   break;
}
$sum=$sum+$day;
echo "$sum";
?>